<h2>Les sondages</h2>


<div class="col4 left">
    <h3> Les sondages </h3>

    <?php
    if (!empty($polls)){
        ?>
        
    <ul class="poll">
        <?php
        foreach ($polls as $poll){
            $poll = $poll['ActionPoll'];
            ?>
                <li> <h4 class="title"><?php echo $this->Display->link($poll, 'ActionPoll');?> </h4></li>
        <?php
        }
        ?>
                
    </ul>
    <?php
    }
    else{
        ?>
        <p>
            Aucun sondage. 
        </p>
    <?php
    }
    ?>
    <p>        
        <?php
        echo $this->Html->link('Créer un sondage', array('action' => 'add'));
        ?>   
    </p>
</div>
    <div class="col6 right">

        <h3> Sondage en cours d'éditon </h3>

        <?php

        if (!empty($pollsEdit)){
            ?>
        <table>
            <thead>
                <tr>
                    <td> Titre </td>
                    <td> Options </td>
                </tr>
            </thead>
            <tbody>
                
        <?php
            foreach ($pollsEdit as $poll){
                $poll = $poll['ActionPoll'];
                ?>
                <tr class="poll">
                    <td class="title"><?php echo $this->Html->link($poll['title'], array('action' => 'addQuestions'));?> </td>
                    <td class="title"><?php echo $this->Html->link('Publier', array('action' => 'setReadyStatus', $poll['actions_id'] ));?> </td>
                </tr>
            <?php
            }
            ?>
                
            </tbody>
        </table>
                <?php
        }
        else{
            ?>
            <p>
                Aucun sondage. 
            </p>
        <?php
        }
        ?>
    </div>